<template>
  <div class="ask">
    <van-nav-bar title="提问" left-text="" left-arrow>
      <template #right>
        <span class="ques">发布</span>
      </template>
    </van-nav-bar>
    <div class="msg">
      <van-cell-group inset>
        <van-field
          v-model="message"
          rows="5"
          autosize
          type="textarea"
          maxlength="90"
          placeholder="请输入留言"
          show-word-limit
        />
      </van-cell-group>
      <div class="file-box">
        <van-uploader
          v-model="fileList"
          multiple
          :max-count="3"
          :preview-size="[106, 106]"
        />
      </div>
      <div class="tag-list">
        <div class="tag">
          <van-tag
            v-if="show"
            closeable
            size="medium"
            type="primary"
            color="#0DC678"
            @close="close"
          >
            测试专家
          </van-tag>
        </div>
      </div>
      <div class="btn">
        <div class="btn-head">
          <div class="btn-f"><img src="@img/q0.png" alt="" />邀请回答</div>
          <div class="btn-f-img">
            <img src="@img/q2.png" alt="" /><img src="@img/q3.png" alt="" /><img
              src="@img/q1.png"
              alt=""
            />
          </div>
        </div>
        <div class="tag">
          <van-nav-bar>
            <template #right>
              <van-icon name="arrow" />
            </template>
            <template #left>
              <img class="addtag" src="@img/q4.png" alt="" />添加标签
            </template>
          </van-nav-bar>
          <div class="list">
            <span v-for="i in 4" :key="i"># 今日打卡</span>
          </div>
        </div>
      </div>
    </div>
    <van-overlay :show="overlayShow" @click="overlayShow = false">
      <div class="wrapper" @click.stop>
        <div class="block">
          <van-icon
            class="close"
            name="close"
            color="#ffffff"
            size="32"
            @click="overlayShow = false"
          />
          <div class="m1">
            <img src="@img/m1.png" alt="" />
            <img style="margin-left: -7px" src="@img/m2.png" alt="" />
          </div>
          <div class="pic">58689</div>
          <div class="desc">金币总额</div>
          <div class="r-i">
            <input type="number" v-model="money" />
          </div>
          <div class="r-b">立即悬赏</div>
        </div>
      </div>
    </van-overlay>
  </div>
</template>

<script>
export default {
  data() {
    return {
      message: "",
      fileList: [],
      show: true,
      overlayShow: true,
      money: 1234,
    };
  },
  methods: {
    close() {
      this.show = false;
    },
  },
};
</script>

<style lang="scss" scoped>
.ask {
  background: #f4f4f6;
  height: 100vh;
  .ques {
    background: linear-gradient(126deg, #54d781 0%, #00c37d 100%);
    border-radius: 16px;
    font-family: PingFangSC, PingFang SC;
    font-weight: 400;
    font-size: 12px;
    color: #ffffff;
    line-height: 17px;
    text-align: center;
    font-style: normal;
    padding: 3px 11px;
  }
  .file-box {
    padding: 0 16px;
  }
  .tag-list {
    padding: 16px;
  }
  .btn {
    position: fixed;
    bottom: 0;
    width: 100%;
    padding: 0 16px;
    .btn-head {
      display: flex;
      padding-bottom: 19px;
      border-bottom: 1px solid rgba(0, 0, 0, 0.05);
      .btn-f {
        flex: 1;
        font-family: PingFangSC, PingFang SC;
        font-weight: 500;
        font-size: 14px;
        color: #272b2d;
        line-height: 20px;
        text-align: left;
        font-style: normal;
        img {
          margin-right: 5px;
          vertical-align: middle;
        }
      }
      .btn-f-img {
        img {
          margin-right: 17px;
        }
      }
    }
  }
  .tag {
    padding-bottom: 40px;
    .addtag {
      margin-right: 4px;
    }
    ::v-deep(.van-nav-bar__left) {
      padding: 0;
    }
    .list {
      margin-top: 18px;
      span {
        font-family: PingFangSC, PingFang SC;
        font-weight: 400;
        font-size: 14px;
        color: #272b2d;
        line-height: 20px;
        text-align: left;
        font-style: normal;
        margin-right: 14px;
      }
    }
  }
  .wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    .block {
      width: 236px;
      height: 277px;
      background: linear-gradient(180deg, #ffe6b1 0%, #ffffff 100%);
      border-radius: 24px;
      background-color: #fff;
      position: relative;
      .m1 {
        margin-top: -43px;
        text-align: center;
      }
      .pic {
        font-family: PingFangSC, PingFang SC;
        font-weight: 500;
        font-size: 32px;
        color: #ff8113;
        line-height: 45px;
        text-align: center;
        font-style: normal;
        margin-top: 14px;
      }
      .desc {
        font-family: PingFangSC, PingFang SC;
        font-weight: 400;
        font-size: 18px;
        color: #2a2a2a;
        line-height: 25px;
        text-align: center;
        font-style: normal;
        margin-bottom: 22px;
      }
      .r-i {
        text-align: center;
        margin-bottom: 18px;
        input {
          width: 184px;
          height: 41px;
          background: rgba(255, 121, 29, 0.2);
          border-radius: 21px;
          border: 1px solid #ffffff;
          padding: 0 12px;
        }
      }
      .r-b {
        width: 190px;
        height: 42px;
        background: linear-gradient(270deg, #1ca893 0%, #1bcd74 100%);
        border-radius: 21px;
        font-family: PingFangSC, PingFang SC;
        font-weight: 400;
        font-size: 16px;
        color: #ffffff;
        line-height: 42px;
        text-align: center;
        font-style: normal;
        margin: 0 auto;
      }
      .close {
        position: absolute;
        right: -32px;
        top: -37px;
      }
    }
  }
}
</style>
